package com.google.code.swingonfire.showcase.graphic.sketch;

import com.google.code.swingonfire.plotter.ArrowSketch;
import com.google.code.swingonfire.plotter.LunarSketch;
import com.google.code.swingonfire.plotter.MoonSketch;
import com.google.code.swingonfire.plotter.NEdgePolygonSketch;
import com.google.code.swingonfire.plotter.Sketch;
import com.google.code.swingonfire.plotter.SunSketch;
import com.google.code.swingonfire.showcase.utils.ConstantParameterDefinition;
import com.google.code.swingonfire.showcase.utils.DoubleSliderParameterDefinition;
import com.google.code.swingonfire.showcase.utils.IntSliderParameterDefinition;
import com.google.code.swingonfire.showcase.utils.ParameterDefinition;

public enum SketchSample
{

    ARROW(ArrowSketch.class, new DoubleSliderParameterDefinition("Pointer Length", 0, 0.5, 2, 0.25, 0.05),
        new DoubleSliderParameterDefinition("Tail Length", 0, 0.5, 2, 0.25, 0.05), new DoubleSliderParameterDefinition(
            "Tail Width", 0, 0.5, 1, 0.25, 0.05)),
    N_EDGE_POLYGON(NEdgePolygonSketch.class, new IntSliderParameterDefinition("Edges", 3, 6, 16, 3, 1),
        new ConstantParameterDefinition<Double>("Radius", 8.0)),
    SUN(SunSketch.class, new IntSliderParameterDefinition("Rays", 5, 8, 32, 3, 1)),
    MOON(MoonSketch.class),
    LUNAR(LunarSketch.class, new DoubleSliderParameterDefinition("Phase", 0, 0.5, 2, 0.25, 0.05));

    private final Class<? extends Sketch> type;
    private final ParameterDefinition<?, ?>[] parameterDefinitions;

    private SketchSample(Class<? extends Sketch> type, ParameterDefinition<?, ?>... parameterDefinitions)
    {
        this.type = type;
        this.parameterDefinitions = parameterDefinitions;
    }

    public Class<? extends Sketch> getType()
    {
        return type;
    }

    public ParameterDefinition<?, ?>[] getParameterDefinitions()
    {
        return parameterDefinitions;
    }

    @Override
    public String toString()
    {
        return type.getSimpleName();
    }

}
